<template>
    <div>
        <ul class="mui-table-view" >
				<li class="mui-table-view-cell mui-media" v-for="item in newslist" :key="item.array">
					<router-link :to="'/home/newsinfo/'+item.forward">
						<img class="mui-media-object mui-pull-left" :src="item.header">
						<div class="mui-media-body">
							<h2>{{item.username}}</h2>
							<p class='mui-ellipsis'><span>发表时间：{{item.passtime}}</span>
                            <span>点击：{{item.down}}</span></p>
						</div>
					</router-link>
				</li>

			</ul>
       
    </div>
</template>
<script>
import {Toast} from "mint-ui"

export default {
    data() {
        return {
            newslist:[]
        }
    },
    created() {
        this.getNewsList();
    },
    methods: {
        getNewsList(){
            this.$http.get('satinGodApi?type=5&page=1').then(result=>{
               console.log(result.body);
                if(result.body.code===200){
                    this.newslist=result.body.data;
                }else{
                    Toast("获取新闻列表失败！")
                }
            })
        }
    },
}
</script>
<style lang="less" scoped>
    .mui-table-view{
        h2{
           font-size: 15px; 
        }
        .mui-ellipsis{
            font-size: 12px;
            color:#226aff;
            display: flex;
            justify-content: space-between
        }
    }
</style>
